#include "fmiAdapter.h"
#include "stringSplit.h"

int main(int argc, char* argv[])
{
	string fmuFile, spckFile;
	for (int i = 0; i < argc; i++)
	{
		vector< string> argvLine = StringSplit::SplitWithStl(argv[i], "=");		
		if (argvLine.size() == 2)
		{
			if (argvLine[0] == "fmu")
			{
				fmuFile = argvLine[1];
			}	
			else if(argvLine[0] == "spck")
			{
				spckFile = argvLine[1];
			}
		}
	}	
	//fmuFile = "C:\\Users\\jinwe\\source\\repos\\edem2simpack\\build\\bucket_bin\\bucket_bin.fmu";
	//spckFile = "C:\\Users\\jinwe\\source\\repos\\edem2simpack\\build\\bucket_bin\\main_model\\bucket_bin.spck";
	
	FMIAdapter fmiAdapter(fmuFile, spckFile);
	fmiAdapter.RunSimulation();
	printf("coupling simulation is finished. ");
}